package main

import "fmt"

func countPoints(rings string) int {
	bucket := make([]int, 101)
	max := 0
	for i := 1; i < len(rings); i += 2 {
		c := rings[i-1]
		index := int(rings[i] - '0')
		if index > max {
			max = index
		}
		var left = 0
		if c == 'R' {
			left = 1
		} else if c == 'G' {
			left = 2
		} else {
			left = 3
		}
		bucket[index] |= 1 << left
	}

	found := 1<<1 | 1<<2 | 1<<3
	res := 0
	for i := 0; i <= max; i++ {
		if bucket[i] == found {
			res++
		}
	}
	return res
}

func main() {
	fmt.Println(countPoints("B0R0G0R9R0B0G0"))
	fmt.Println(countPoints("G4"))

}
